from Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    # 定位器
    # 封装元素的操作方法

    # 1.点击新增按钮
    add_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]')
    def click_addbtn(self):
        self.click(self.add_loc)

    # 2.输入版本名称
    versionname_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[1]/div/div[1]/div/input')
    def sr_versionname(self):
        self.send_keys(self.versionname_loc,'版本2.0')

    # 3.输入发布日期
    releasedate_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[2]/div/div[1]/div/input')
    def sr_releasedate(self):
        self.send_keys(self.releasedate_loc,'2025-06-11')

    # 4.点击版本状态框
    statusK_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/div[1]/div[2]')
    def click_statusK(self):
        self.click(self.statusK_loc)

   # 5.点击状态
    status_loc = (By.XPATH, '/html/body/div[2]/div/div/div/div[1]/ul/li[1]')
    def click_status(self):
        self.click(self.status_loc)

    # 5.点击提交
    com_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[4]/div/button[1]/span')
    def click_com(self):
        self.click(self.com_loc)